package com.chengdu.third.service.Impl;

import com.chengdu.third.dao.IPtypeDao;
import com.chengdu.third.pojo.Ptype;
import com.chengdu.third.service.IPtypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jingbo
 * @create 2021--08--15  21:42
 */

@Service
public class IPtypeServiceImpl implements IPtypeService {

    @Autowired
    private IPtypeDao iPtypeDao;

    @Override
    public List<Ptype> findAll() {
        return iPtypeDao.find();
    }

    @Override
    public void deleteByid(long id) {
         iPtypeDao.delete(id);
    }

    @Override
    public void updateByid(Ptype ptype) {
           iPtypeDao.update(ptype);
    }

    @Override
    public void add(Ptype ptype) {
        iPtypeDao.add(ptype);
    }

    @Override
    public Ptype getPtypeById(long id) {
        return iPtypeDao.getPtypeById(id);
    }
}
